<!DOCTYPE html>
<html>
<head>
<title>KSG</title>
<meta charset="gbk">
<meta name="viewport" content="width=device-width, initial-scale=0.9, user-scalable=no">
<script src="/assets/lib/jquery/1.9.1/jquery.min.js"></script>
<link rel="stylesheet" href="/assets/lib/bootstrap/css/bootstrap.min.css" />
<style>
#data {
    margin: 20px 0;
    padding: 10px 0;
}

#data table {
    border: 1px solid #ccc;
    width: 100%;
}
#data table td {
    border-bottom: 1px solid #ccc;
}
.clear{
	zoom:1;
}
.clear:after{
	content:"";
	height:0;
	visibility:hidden;
	clear:both;
	display:block;
}
</style>

<script>
var path_to_cgi = "/cgi-bin/cpp-upload.exe?";

var tmp_data = "";

function GetData()
{
    var url = path_to_cgi + "/=" + Math.random();
    $.get(url, function(data, status) {
		if (data != tmp_data)
		{
			$("#data").html(data);
			tmp_data = data;
		}
    });
}

$(document).ready(function() {
    GetData();
    // setInterval("GetData()", 5000);
});

function UploadSuccess()
{
    GetData();
}

</script>
</head>
<body>
  <div style="width:400px;margin:0 auto;padding-top:60px;font-size:18px;font-weight:bold">
    <iframe style="display: none" name="up-result" src="about:blank"></iframe>
    <form action="/cgi-bin/cpp-upload.exe" method="post" enctype="multipart/form-data" target="up-result">
      <input name="callback" type="hidden" value="UploadSuccess" />
      <div class="clear">
        <input style="float:left;width:300px" type="file" name="upfile" multiple="multiple" />
        <input style="float:right;width:100px" type="submit" value="Upload" />
      </div>
      <textarea name="scrapbook" style="width:100%;min-height:100px;resize:vertical"></textarea> 
    </form>
  </div>
  
  <div style="width:400px;margin:0 auto;font-size:18px;font-weight:bold">
    <div id="data"></div>
  </div>
</body>
</html>